package com.qfedu.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Administrator
 * @date 2024/11/23 下午4:12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R<T> {
    private Integer code;
    private String msg;
    private T data;

    public static R ok(Object data) {
        return new R(1, "success", data);
    }
      public static R ok(String msg,Object data) {
        return new R(1, "success", data);
    }

    public static R error(String msg) {
        return new R(0, msg, null);
    }
}
